package com.qt.myio;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * @Author zsf
 * @Date 2023/9/24 14:41
 * @Version 1.0
 */
public class ByteStreamDemo01 {

    public static void main(String[] args) throws IOException {


        /**
         * try ---with--resource
         */


        try (FileInputStream fis = new FileInputStream("aaa\\a.txt");
             FileOutputStream fos = new FileOutputStream("aaa\\b.txt");){
            int len;
            byte[] bytes = new byte[1024 * 1024 * 5];
            while ((len = fis.read(bytes)) != -1){
                fos.write(bytes,0,len);
            }
            /*fos.close();
            fis.close();*/
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
        }


    }

}
